<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="common/jspcommon.jsp"%>
<%
	String path = request.getContextPath();
	// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量 
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。 
	pageContext.setAttribute("basePath", basePath);
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>Art运营中心</title>
<style type="text/css">
	
</style>
<%@include file="common/jscss.jsp"%>
<script src="/js/menu.js" type="text/javascript"></script>
<script type="text/javascript">
    var tab = null;
    var accordion = null;
    var tree = null;
    var menu;
    var actionNodeID;
    $(function ()
    {

        //布局
        $("#layout1").ligerLayout({ leftWidth: 190, height: '100%',heightDiff:-34,space:4});

        var height = $(".l-layout-center").height();

        //Tab
        $("#framecenter").ligerTab({ height: height });

        
        menu = $.ligerMenu({
			top : 100,
			left : 100,
			width : 120,
			items : [ {
				text : '增加',
				click : openAddChannel,
				icon : 'add'
			}, {
				text : '修改',
				click : openUpdateChannel,
				icon : 'modify'
			} ]
		});
        
        //树
        $("#tree1").ligerTree({
            url : "/misc/menu.htm",
            checkbox: false,
            slide: false,
            nodeWidth: 120,
            attribute: ['nodename', 'url'],
            btnClickToToggleOnly : false,
            onSelect: function (node)
            {
                if (!node.data.url) return;
                var tabid = $(node.target).attr("tabid");
                if (!tabid)
                {
                    tabid = new Date().getTime();
                    $(node.target).attr("tabid", tabid);
                } 
              //  f_addTab(tabid, node.data.text, node.data.url);
                tab.overrideSelectedTabItem({ url: node.data.url,text: node.data.text,tabid : tabid });
            },
            onContextmenu : function(node, e) {
            	if(node.data.text == "内容管理" || node.data.id != undefined){
            		actionNodeID = node.data.id;
    				menu.show({
    					top : e.pageY,
    					left : e.pageX
    				});
    				return false;
            	}
			}
        });
        
        tab = $("#framecenter").ligerGetTabManager();
        tree = $("#tree1").ligerGetTreeManager();
        $("#pageloading").hide();

    });
   /*
    function f_addTab(tabid,text, url)
    { 
        tab.addTabItem({ tabid : tabid, text: text, url: url });
    } 
    */
    //右击频道事件(更新频道)
    function openUpdateChannel(){
    	dialog_ae = $.ligerDialog.open({ height: 300,width:500, url: "/misc/cms/toEditChannel.htm?channelId="+actionNodeID, isResize: false ,modal:true,title:'更新频道'});
    }
  	//右击频道事件(添加频道)
    function openAddChannel(){
    	dialog_ae = $.ligerDialog.open({ height: 500,width:500, url: "/misc/cms/toAddChannel.htm?channelId="+actionNodeID, isResize: false ,modal:true,title:'添加频道'});
    }
    
</script> 
 
<style type="text/css"> 
    body,html{height:100%;}
    body{ padding:0px; margin:0;   overflow:hidden;}  
    .l-link2{text-decoration:underline; color:white; margin-left:2px;margin-right:2px;}
    .l-layout-top{background:#102A49; color:White;}
    .l-layout-bottom{ background:#E5EDEF; text-align:center;}
    #pageloading{position:absolute; left:0px; top:0px; width:100%; height:100%;z-index:99999;}
    .l-link{ display:block; line-height:22px; height:22px; padding-left:16px;border:1px solid white; margin:4px;}
    .l-link-over{ background:#FFEEAC; border:1px solid #DB9F00;} 
    .l-winbar{ background:#2B5A76; height:30px; position:absolute; left:0px; bottom:0px; width:100%; z-index:99999;}
    .space{ color:#E7E7E7;}
    /* 顶部 */ 
    .l-topmenu{ margin:0; padding:0; height:31px; line-height:31px; background:url('/third/lib/images/top.jpg') repeat-x bottom;  position:relative; border-top:1px solid #1D438B;  }
    .l-topmenu-logo{ color:#E7E7E7; padding-left:35px; line-height:26px;background:url('/third/lib/images/topicon.gif') no-repeat 10px 5px;}
    .l-topmenu-welcome{  position:absolute; height:24px; line-height:24px;  right:30px; top:2px;color:#070A0C;}
    .l-topmenu-welcome a{ color:#E7E7E7; text-decoration:underline} 
	.l-layout-left{overflow: auto;}
 </style>
</head>
<body style="padding:0px;background:#EAEEF5;">  
<div id="pageloading"></div>  
<div id="topmenu" class="l-topmenu">
    <div class="l-topmenu-logo">Art后台管理系统</div>
    <div class="l-topmenu-welcome">
        <a href="javascript:;"><%=request.getAttribute("realname")%></a>
        <span class="space">|</span>
         <a href="<c:url value="/misc/j_spring_security_logout"/>" class="l-link2">退出</a>
    </div> 
</div>
  <div id="layout1" style="width:99.2%; margin:0 auto; margin-top:4px; "> 
        <div position="left"  title="菜单" id="accordion1"> 
                 <ul id="tree1" style="margin-top:3px;"></ul>
        </div>
        <div position="center" id="framecenter"> 
            <div tabid="home" title="欢迎你" style="height:300px" >
                	欢迎登陆后台
            </div>
        </div> 
        
    </div>
    <div  style="height:32px; line-height:32px; text-align:center;">
            Copyright © 2011-2012 
    </div>
    <div style="display:none"></div>
</body>
</html>